package com.zyz.rabbitmqspringboot.listener;

import com.zyz.rabbitmqspringboot.constants.Constants;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class TopicListener {
    @RabbitListener(queues = Constants.TOPIC_QUEUE1)
    public void topicQueue1(String message) {
        System.out.println("listener1 [" + Constants.TOPIC_QUEUE1 + "] 接收到消息：" + message);
    }
    @RabbitListener(queues = Constants.TOPIC_QUEUE2)
    public void topicQueue2(String message) {
        System.out.println("listener2 [" + Constants.TOPIC_QUEUE2 + "] 接收到消息：" + message);
    }
}
